﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace LogicUniversitySS
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ddCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            string cs1 = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SSIS.mdf;Integrated Security=True;User Instance=True";
            string query = "SELECT ItemId,Description FROM [Catalogue] where CategoryId='" + DdlCategory.SelectedValue.ToString() + "'";
            SqlDataAdapter adapt1 = new SqlDataAdapter(query, cs1);
            DataSet dataSet = new DataSet();
            adapt1.Fill(dataSet);
            DataTable dt1 = dataSet.Tables[0];
            GvCategroy.DataSource = dataSet;
            GvCategroy.DataBind();
            
        }

        protected void GvCategroy_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}